<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a="http://richfaces.org/a4j"
    template="/layout/template.xhtml">

<ui:define name="body">

    <h:form id="localidadeForm">

        <rich:panel>
            <f:facet name="header">Localidade por Cargo</f:facet>

           	<s:decorate id="filtroConcursoCandidato" template="/layout/edit.xhtml">
                <ui:define name="label">Concurso</ui:define>
                <h:selectOneMenu value="#{cargoList.concurso}" >
	                 <s:selectItems value="#{concursoList.resultList}" var="_iten" itemValue="#{_iten}"  label="#{_iten.nome}"  noSelectionLabel="Selecione um Concurso" hideNoSelectionLabel="false"/>
	                 <s:convertEntity/>
	                 <a:support event="onchange" action="#{cargoList.buscar}"  reRender="filtroCargoCandidato" ajaxSingle="true" />
                </h:selectOneMenu>
            </s:decorate>
            
           	<s:decorate id="filtroCargoCandidato" template="/layout/edit.xhtml">
                <ui:define name="label">Cargo</ui:define>
                <h:selectOneMenu value="#{localidadeHome.instance.cargo}" >
	                 <s:selectItems value="#{listaDeCargos}" var="_iten" itemValue="#{_iten}"  label=" #{_iten.codigo} - #{_iten.nome}"  noSelectionLabel="Selecione um Cargo" hideNoSelectionLabel="false"/>
	                 <s:convertEntity/>
                </h:selectOneMenu>
            </s:decorate>


            <s:decorate id="codigoField" template="/layout/edit.xhtml">
                <ui:define name="label">Codigo</ui:define>
                <h:inputText id="codigo" required="true"
                             value="#{localidadeHome.instance.codigo}"/>
            </s:decorate>
            
            <s:decorate id="nameField" template="/layout/edit.xhtml">
                <ui:define name="label">Name</ui:define>
                <h:inputText id="name" required="true"
                             value="#{localidadeHome.instance.nome}"/>
            </s:decorate>
            
            <s:decorate id="vagaField" template="/layout/edit.xhtml">
                <ui:define name="label">Vagas</ui:define>
                <h:inputText id="vaga" required="true"
                             value="#{localidadeHome.instance.vagas}"/>
            </s:decorate>

            <div style="clear:both"/>

        </rich:panel>

        <div class="actionButtons">
            <h:commandButton id="save"
                          value="Gravar"
                         action="#{localidadeHome.persist}"
                       rendered="#{!localidadeHome.managed}"/>
            <h:commandButton id="update"
                          value="Gravar"
                         action="#{localidadeHome.update}"
                       rendered="#{localidadeHome.managed}"/>
            <h:commandButton id="delete"
                          value="Excluir"
                         action="#{localidadeHome.remove}"
                      immediate="true"
                       rendered="#{localidadeHome.managed}"/>
            <s:button propagation="end"
                               id="cancel"
                            value="Cancelar"
                             view="/modulo//localidadeList.xhtml"/>
        </div>

    </h:form>

</ui:define>

</ui:composition>
